mod common;
use crate::common::dourl;
use serde_json::json;

#[tokio::test]
async fn cache() {
    let ret = dourl(
        json!({
            "tick": 200,
            "stamp": 200,
        }),
        "cache",
        "add",
    )
    .await
    .expect("addcache");
    assert_eq!(
        ret,
        json!({
            "tick": 200,
            "stamp": 200,
        })
    );

    let ret = dourl(json!({}), "cache", "list").await.expect("list");
    assert_eq!(
        ret,
        json!({
            "tick": 200,
            "stamp": 200,
        })
    );

    let ret = dourl(json!({}), "cache", "update").await.expect("update");
    assert_eq!(ret, json!("Success"));

    let ret = dourl(json!({}), "cache", "list").await.expect("list");
    dbg!(ret);
}
